package com.zhp.ex;

import lombok.Data;
import org.springframework.http.HttpStatus;

/**
 * @author zhanghp
 * @since 2024/5/16 17:37
 */
@Data
public class CustomException extends RuntimeException{

    private int code;

    private String msg;

    public CustomException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public CustomException(String msg) {
        this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
        this.msg = msg;
    }

}
